package recursivecode.trymodel.left2right;

/**
 * 功能描述:字符枚举
 * 2024/07/15
 *
 * @author ZhangYi
 * @see Enum
 */
public enum CharacterEnum {
	A("1", "A"),
	B("2", "B"),
	C("3", "C"),
	D("4", "D"),
	E("5", "E"),
	F("6", "F"),
	G("7", "G"),
	H("8", "H"),
	I("9", "I"),
	J("10", "J"),
	K("11", "K"),
	L("12", "L"),
	M("13", "M"),
	N("14", "N"),
	O("15", "O"),
	P("16", "P"),
	Q("17", "Q"),
	R("18", "R"),
	S("19", "S"),
	T("20", "T"),
	U("21", "U"),
	V("22", "V"),
	W("23", "W"),
	X("24", "X"),
	Y("25", "Y"),
	Z("26", "Z");


	private String key;
	private String value;

	CharacterEnum(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}
	public String getValue() {
		return value;
	}

	public static String getValueByKey(String key) {
		for (CharacterEnum characterEnum : CharacterEnum.values()) {
			if (characterEnum.getKey().equals(key)) {
				return characterEnum.getValue();
			}
		}
		System.out.println(String.format("%s 没有找到对应的值",key));
		return null;
	}


	public static void main(String[] args) {
		System.out.println(CharacterEnum.getValueByKey("11"));
	}
}
